<table id="businesspartners" class="admingrid">
</table>
<div id="businesspartners_pager"></div>
<br>
<button onclick="addbusinesspartner()">Add businesspartner</button>
<button onclick="removebusinesspartners()">Remove selected businesspartners</button>

<script>
grids.businesspartners = {
    url : generateServiceUrl({
        admin : true,
        service : "getbusinesspartners",
        page : "group_members"
    }),
    colNames : [
        "Partner name",
        "Contact person",
        "Email"
    ],
    colModel : [
        { name : "businesspartner_name", index : "businesspartner_name",  width : 300 },
        { name : "contact_person",  index : "contact_person",   width : 170 },
        { name : "email",           index : "email",            width : 150 }
    ],
    caption : "businesspartners list",
    multiselect : true,
    multiboxonly : true,
    height : 320
};

function addBusinesspartner() {
    openAdminPopup("group_members", "add", {
        title : "Adding businesspartner"
    }, {
        membertype : "businesspartners"
    });
}

function removebusinesspartners() {
    if (confirm("Are you sure to want to delete selected businesspartners?")) {
        var selectedItems = getSelectedRows("businesspartners");
        callAdminService("group_members", "delete", {
            ids : selectedItems
        }, {
            success : function(result) {
                refreshGrid("businesspartners");
            }
        });
    }
}

</script>
